﻿using System;
using System.Deployment.Application;
using System.IO;
using System.Windows;
using log4net;
using log4net.Appender;
using log4net.Config;
using log4net.Layout;

namespace ClimateControl.Client
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            string file = "log.txt";

            if (ApplicationDeployment.IsNetworkDeployed)
                file = Path.Combine(ApplicationDeployment.CurrentDeployment.DataDirectory, file);

            var fileAppender = new FileAppender(new PatternLayout(), file, true);

            BasicConfigurator.Configure(fileAppender);
        }
    }
}
